class EnterModel {
  int id;
  String orderNo;
  String caseName;
  int type;
  String caseNo = '----------------------------';
  int departmentId;
  int status;
  String submissionTime;
  int creatorId;
  int receptorId;
  String createTime;
  int receptTime;
  int updateId;
  String updateTime;
  int deleteTime;
  String remark;
  int transferId;
  int approvorId;
  String approvalTime;
  String approvalOpinion;
  int handlerId;
  String handleTime;
  String handleOpinion;
  String applyTime;
  String applyOpinion;
  int enterType;
  Department department;
  User user;
  Apply apply;
  Null approver;
  Null handler;
  String statusText;

  EnterModel(
      {this.id,
      this.orderNo,
      this.caseName,
      this.type,
      this.caseNo,
      this.departmentId,
      this.status,
      this.submissionTime,
      this.creatorId,
      this.receptorId,
      this.createTime,
      this.receptTime,
      this.updateId,
      this.updateTime,
      this.deleteTime,
      this.remark,
      this.transferId,
      this.approvorId,
      this.approvalTime,
      this.approvalOpinion,
      this.handlerId,
      this.handleTime,
      this.handleOpinion,
      this.applyTime,
      this.applyOpinion,
      this.enterType,
      this.department,
      this.user,
      this.apply,
      this.approver,
      this.handler,
      this.statusText});

  EnterModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    orderNo = json['order_no'];
    caseName = json['case_name'];
    type = json['type'];
    caseNo = json['case_no'];
    departmentId = json['department_id'];
    status = json['status'];
    submissionTime = json['submission_time'];
    creatorId = json['creator_id'];
    receptorId = json['receptor_id'];
    createTime = json['create_time'];
    receptTime = json['recept_time'];
    updateId = json['update_id'];
    updateTime = json['update_time'];
    deleteTime = json['delete_time'];
    remark = json['remark'];
    transferId = json['transfer_id'];
    approvorId = json['approvor_id'];
    approvalTime = json['approval_time'];
    approvalOpinion = json['approval_opinion'];
    handlerId = json['handler_id'];
    handleTime = json['handle_time'];
    handleOpinion = json['handle_opinion'];
    applyTime = json['apply_time'];
    applyOpinion = json['apply_opinion'];
    enterType = json['enter_type'];
    department = json['department'] != null
        ? new Department.fromJson(json['department'])
        : null;
    user = json['user'] != null ? new User.fromJson(json['user']) : null;
    apply = json['apply'] != null ? new Apply.fromJson(json['apply']) : null;
    approver = json['approver'];
    handler = json['handler'];
    statusText = json['status_text'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['order_no'] = this.orderNo;
    data['case_name'] = this.caseName;
    data['type'] = this.type;
    data['case_no'] = this.caseNo;
    data['department_id'] = this.departmentId;
    data['status'] = this.status;
    data['submission_time'] = this.submissionTime;
    data['creator_id'] = this.creatorId;
    data['receptor_id'] = this.receptorId;
    data['create_time'] = this.createTime;
    data['recept_time'] = this.receptTime;
    data['update_id'] = this.updateId;
    data['update_time'] = this.updateTime;
    data['delete_time'] = this.deleteTime;
    data['remark'] = this.remark;
    data['transfer_id'] = this.transferId;
    data['approvor_id'] = this.approvorId;
    data['approval_time'] = this.approvalTime;
    data['approval_opinion'] = this.approvalOpinion;
    data['handler_id'] = this.handlerId;
    data['handle_time'] = this.handleTime;
    data['handle_opinion'] = this.handleOpinion;
    data['apply_time'] = this.applyTime;
    data['apply_opinion'] = this.applyOpinion;
    data['enter_type'] = this.enterType;
    if (this.department != null) {
      data['department'] = this.department.toJson();
    }
    if (this.user != null) {
      data['user'] = this.user.toJson();
    }
    if (this.apply != null) {
      data['apply'] = this.apply.toJson();
    }
    data['approver'] = this.approver;
    data['handler'] = this.handler;
    data['status_text'] = this.statusText;
    return data;
  }
}

class Department {
  int id;
  String departmentName;

  Department({this.id, this.departmentName});

  Department.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    departmentName = json['department_name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['department_name'] = this.departmentName;
    return data;
  }
}

class User {
  int id;
  String name;

  User({this.id, this.name});

  User.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    return data;
  }
}

class Apply {
  int id;
  String name;

  Apply({this.id, this.name});

  Apply.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    return data;
  }
}
